//


#import "NT_FootDeleteView.h"

@implementation NT_FootDeleteView

- (instancetype)initWithFrame:(CGRect)frame {
    if ([super initWithFrame:frame]) {
        [self creatView];
    }
    return self;
}
//
- (void)creatView {
    
    self.allSelectBtn = [[UIButton alloc]init];
    [self.allSelectBtn setTitle:@"Exit" forState:UIControlStateNormal];
    [self.allSelectBtn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
    [self.allSelectBtn addTarget:self action:@selector(exitAction) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:self.allSelectBtn];
    [self.allSelectBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_offset(kRelativeHeight(15));
        make.left.mas_offset(0);
        make.width.mas_equalTo(kMainScreenWidth/2);
        make.height.mas_equalTo(kRelativeHeight(20));
    }];
    
    //
    self.deleteButton = [[UIButton alloc]init];
    [self.deleteButton setTitle:@"Delete" forState:UIControlStateNormal];
    [self.deleteButton setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
    [self.deleteButton addTarget:self action:@selector(deleteAction) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:self.deleteButton];
    [self.deleteButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_offset(kRelativeHeight(15));
        make.left.mas_equalTo(self.allSelectBtn.mas_right);
        make.right.mas_offset(0);
        make.height.mas_equalTo(kRelativeHeight(20));
    }];
    
}
//MARK:删除
- (void)deleteAction {
    if ([self.delegate respondsToSelector:@selector(sendDeleteData)]) {
        [self.delegate sendDeleteData];
    }
    
}
- (void)exitAction {
    if ([self.delegate respondsToSelector:@selector(exit)]) {
        [self.delegate exit];
    }
    [self removeFromSuperview];
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
